//package com.ysmart.rule.concurent.executor;
//
//import java.util.concurrent.ExecutorService;
//import java.util.concurrent.Executors;
//import java.util.concurrent.Future;
//import java.util.concurrent.LinkedBlockingDeque;
//import java.util.concurrent.ThreadPoolExecutor;
//import java.util.concurrent.TimeUnit;
//
//import org.noear.solon.annotation.Component;
//import org.noear.solon.core.aspect.Invocation;
//import org.noear.solon.scheduling.annotation.Async;
//import org.noear.solon.scheduling.async.AsyncExecutor;
//
///**
// * @ClassName: AsyncLogExecutorImpl
// * @Description: 自定义异步日志线程池
// * @author weiyongpeng
// * @date 2025年1月27日 下午4:10:24
// */
//@Component(value = "asyncRuleThreadExecutor")
//public class AsyncRuleExecutorImpl implements AsyncExecutor {
//
//	// 自定义线程池
//	ExecutorService executor = new ThreadPoolExecutor(5, 10, 10, TimeUnit.SECONDS, new LinkedBlockingDeque<>(30),
//			Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy());
//
//	@Override
//	public Future<?> submit(Invocation inv, Async anno) throws Throwable {
//		if (inv.method().getReturnType().isAssignableFrom(Future.class)) {
//			return (Future<?>) inv.invoke();
//		} else {
//			return executor.submit(() -> {
//				try {
//					return inv.invoke();
//				} catch (Throwable e) {
//					throw new RuntimeException(e);
//				}
//			});
//		}
//	}
//
//}
